<template>
	<view class="bg-gradual-orange">
		<cu-custom bgColor="">
			<block slot="content">闪达物流·安全快速</block>
		</cu-custom>
		<view class="flrc" v-if="$com.isTrue(login)">
			<view>
				<image src="../../../static/logo.png" mode="aspectFill" class="wh20-20 round bdso bdcf bdw5" v-if="!$com.isTrue(user)"></image>
				<image :src="user.pic" mode="aspectFill" class="wh20-20 round bdso bdcf bdw5" v-if="$com.isTrue(user)"></image>
			</view>
		</view>
		<view class="tac mart2" v-if="$com.isTrue(login)">
			{{$com.isTrue(user)?user.name:'注册用户'}}
		</view>
		<view class="tac fs12 mart2" @click="$win.goto('/pages/wuliu/phone/phone')" v-if="$com.isTrue(login)">
			{{$com.isTrue(user)?$com.isTrue(user.phone)?user.phone:'点击绑定手机号':'点击绑定手机号'}}
		</view>
		<view class="text-xxl tac pad5 ripple" @click="$win.goto('/pages/wuliu/login/login')" v-if="!$com.isTrue(login)">
			未登录
		</view>
		<view class="flrc padb5 padt5">
			<view class="flcc flex1">
				<view class="fs30">{{data.order}}</view>
				<view class="text-sm">完成订单</view>
			</view>
			<view class="flcc flex1">
				<view class="fs30">{{data.sons}}</view>
				<view class="text-sm">邀请用户</view>
			</view>
			<view class="flcc flex1">
				<view class="fs30">{{data.money}}</view>
				<view class="text-sm">累计返利</view>
			</view>
		</view>
		<view class="bg-white padt5 fs14">
			
			<view class="flrc pad3 mar2 shadow-blur" @click="$win.goto('/pages/wuliu/inivite/inivite')">
				<view class="wh10-10 bc02 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>推广二维码</view>
					<text class="fs10 c1 fwb">货主领取200元</text>
					</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
			</view>
			<view class="flrc pad3 mar2 shadow-blur" @click="$win.goto('/pages/wuliu/moneyLog/moneyLog')">
				<view class="wh10-10 bc03 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>返佣记录</view>
					<text class="fs10 c1 fwb">货主领取反运费50元</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
			</view>
			<view class="flrc pad3 mar2 shadow-blur" @click="$win.goto('/pages/wuliu/fapiao/fapiao')">
				<view class="wh10-10 bc02 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>订单返利/运费开票</view>
					<text class="fs10 c12">微信客服处理</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
			</view>
			<view class="flrc pad3 mar2 shadow-blur" @click="$win.goto('/pages/wuliu/contact/contact')">
				<view class="wh10-10 bc04 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>联系客服</view>
					<text class="fs10 c12">7*24服务保障</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
			</view>
			<view class="flrc pad3 mar2 shadow-blur" @click="$win.goto('/pages/wuliu/page/page?code=ABOUT')" data-code="ABOUT">
				<view class="wh10-10 bc05 flcc round cf">
					<text class="fa fa-cube"></text>
				</view>
				<view class="flex1 padl5">
					<view>关于我们</view>
					<text class="fs10 c12">业务咨询合作</text>
				</view>
				<view class=""><text class="fa fa-angle-right"></text></view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	export default {
		data() {
			return {
				login: false,
				user: {},
				wuser: {},
				vip: 0,
				data:{
					order:0,
					sons:0,
					money:0
				}
			}
		},
		methods: {
			goto(e) {
				console.log(e)
				// this.$win.goto(url)
			}
		},
		onLoad() {
			
		},
		onShow() {
			let _this = this
			this.login = com.isLogin()
			api.get('/api/get_user_info',{},function(res){
				console.log(res)
				_this.login = res.d.login
				_this.user = res.d.user
				_this.wuser = res.d.wuser
				_this.vip = res.d.vip
			})
			api.get('/api/wuliu/user/home',{},function(res){
				console.log(res)
				_this.data = res.d
			})
		}
	}
</script>

<style>

</style>
